package thefirst.member.model;

import java.sql.SQLException;

import javax.annotation.Resource;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.stereotype.Repository;
/**
 * TeacherOfMemberDaoImpl
 * 	MemberDao를 implements한 클래스.
 *  회원들이면 공통적으로 가지고 있는 메서드를 
 *  선생님 회원에 맞게 overriding 을 진행.
 *  
 *  sqlSessionTemplate을 활용해 Data access.
 * @author kosta-00-30
 *
 */
@Repository
public class TeacherOfMemberDaoImpl implements MemberDao{
@Resource(name="sqlSessionTemplate")
	private SqlSessionTemplate sqlSessionTemplate;

@Override
public void registerMember(MemberVO mvo) throws SQLException {
	sqlSessionTemplate.insert("member.registerTeacher",mvo);
	}

@Override
public MemberVO showMember(MemberVO mvo) throws SQLException {

	return sqlSessionTemplate.selectOne("member.showTeacher", mvo);
}

@Override
public int updateName(MemberVO mvo) throws SQLException {
	// TODO Auto-generated method stub
	return sqlSessionTemplate.update("member.updateTeacherName", mvo);
}

@Override
public int updateGender(MemberVO mvo) throws SQLException {
	// TODO Auto-generated method stub
	return sqlSessionTemplate.update("member.updateTeacherGender", mvo);
}	
@Override
public MemberVO login(MemberVO mvo) throws SQLException {
	return sqlSessionTemplate.selectOne("member.loginteacher", mvo);
}	
}
